__author__ = 'Dianlei Zhang'
import subprocess

print('$ nslookup www.baidu.com')
r = subprocess.call(['nslookup', 'http://www.baidu.com'])
print('Exit code:', r)